﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Configuration;
using System.Data;
using System.ComponentModel;
using System.Windows.Input;

namespace WebLayer
{
    public partial class CreateUser : System.Web.UI.Page
    {


        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void createCustomerBTN_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=balder.ucn.dk;Initial Catalog=dmaa0913_5;User ID=dmaa0913_5;Password=MaaGodt");
            SqlDataAdapter da = new SqlDataAdapter();
            da.InsertCommand = new SqlCommand("INSERT INTO Customer VALUES(@ssn, @creditNO, @name, @street, @house");
            da.InsertCommand.Parameters.Add("@ssn", SqlDbType.Int).Value = ssntxt.Text;
            da.InsertCommand.Parameters.Add("@creditNO", SqlDbType.Int).Value = credittxt.Text;
            da.InsertCommand.Parameters.Add("@name", SqlDbType.Int).Value = nametxt.Text;
            da.InsertCommand.Parameters.Add("@street", SqlDbType.Int).Value = streettxt.Text;
            da.InsertCommand.Parameters.Add("@house", SqlDbType.Int).Value = housetxt.Text;

            con.Open();
            da.InsertCommand.ExecuteNonQuery();
            con.Close();
        }

        

        


    }
}

